TINYXML_USE_STL := YES
CXXSOURCES := $(shell find . -name "*.cpp")
OBJECTS := $(CXXSOURCES:.cpp=.o)
DEPENDENCIES := $(CXXSOURCES:.cpp=.d)
CXXFLAGS := -g -Wall `sdl-config --cflags` -I../ -I../TinyXML
LDFLAGS := `sdl-config --libs` -lSDL_image -lSDL_ttf -lSDL_gfx
LIB := libtinyxml.a

all: $(LIB)

$(LIB): $(OBJECTS)
	$(AR) rv $@ $^

	
%.d:%.cpp
	g++ -MM $(CXXFLAGS) $< | sed 's/\(.*\).o:/\1.o \1.d:/' > $@
	
-include $(DEPENDENCIES)

clean:
	rm -f *.o *.a *.d
	
.PHONY: all clean
